'use client';
import { Provider } from 'react-redux';
import store from '@/store/store';
import { App } from 'antd';
import { setMessageHandler } from '@/utils/request/req';

type Props = {
  children: React.ReactNode;
};

export default function ClientProvider({ children }: Props) {
  const { message } = App.useApp();
  
  // 设置消息处理器
  setMessageHandler({
    success: (content) => message.success(content),
    error: (content) => message.error(content)
  });
  
  return <Provider store={store}>{children}</Provider>;
}
